let user = require('./User')
console.log(user.sayHello());
console.log(`userName:${user.userName}`);

let http = require('http');
let url = require('url');
let util =require('util');

let server = http.createServer((req,res)=>{
	res.statusCode = 200;
	//设置服务器端响应头
	res.setHeader("Content-Type","text/plain;charset=utf-8");
	console.log(req.url);
	res.end(util.inspect(url.parse('http://localhost:3000/demo.html?a=123#tag')));
});

server.listen(3000,'127.0.0.1',()=>{
	console.log('服务器已经运行，请打开浏览，输入: http://127.0.0.1:3000来进行浏览');
})
